home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: argc/argv & switches
- Date: 7 Mar 1996 20:34:06 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4hodbuINNlvv@keats.ugrad.cs.ubc.ca>
- References: <4h2j8j$9gn@milo.freenet.vancouver.bc.ca> <4hl52oINNa4l@anvil.ugrad.cs.ubc.ca> <danpop.826238070@rscernix> <4ho9dv$bcb@castle.nando.net>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4ho9dv$bcb@castle.nando.net>,
- Bill McCarthy <actuary@nando.net> wrote:
- >In <danpop.826238070@rscernix>,
- >danpop@mail.cern.ch (Dan Pop) writes:
- >
- >>In <4hl52oINNa4l@anvil.ugrad.cs.ubc.ca>
- >>c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) writes:
- >>
- >>>However, if it were the case that these pointers are not modifiable,
- >>
- >>It _is_ the case. An attempt to modify a pointer from the argv "array"
- >>results in undefined behaviour.
- >
- >According to Herbert Schildt, 5.1.2.2.1 states "The parameters argc and
- >argv and the strings pointed to by the argv array shall be modifiable
- >by the program, and retain their last-stored values between program
- >startup and program termination."
- >
- >I'm just reading the standard for the first time, and am only up to page
-
- Good for you!
-
- >26 :-( so be kind - what am I missing?
-
- You are missing the observation that argv is a pointer to an array of objects.
- These objects are pointers to char. Although argv is modifiable, these char
- pointers are not. The funny thing is that the data they point to _is_
- modifiable.
-
- Hope this muddies the waters for you.
-
- --
-
-